package com.vanke.devops.domain.enums;

import java.util.HashMap;
import java.util.Map;

/**
 * @author 陈景阳
 * @since 2018/1/3
 */
public interface ErrorCode {

    String PREFIX = "B";

    Map<Class,String> map = new HashMap<Class,String>(){{
        put(AliyunMonitorErrorCode.class,"0000");
        put(EndpointsErrorCode.class,"0001");
        put(CaptchaErrorCode.class,"0002");
        put(UsersErrorCode.class,"0003");
        put(ZuulRouteErrorCode.class,"0004");
        put(ScheduleJobErrorCode.class,"0005");
    }};

    static String getErrorCodePrefix(final Class<? extends ErrorCode> enumClass){
        return PREFIX + map.get(enumClass);
    };

    String getCode();

    String getMessage();
}
